import java.util.*;
public class prime
{
	public static void main(String[] args) 
	{
		Scanner input = new Scanner(System.in); 
		int count = 0; 
		int number = 2; 

		System.out.print("Enter N prime numbers to display: ");
		int N = input.nextInt(); 

		while (count < N) 
		{

			 boolean isPrime = true; 


			 for (int divisor = 2; divisor <= number /2; divisor++)
			 {
				 if (number % divisor == 0)
				 {
					isPrime = false;
					break; 
				 }
			 }

		 if (isPrime)
		 {
			count++;
			System.out.println(number);
		 } 

			number++;
		}
	}
}
